<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改页面</title>
</head>
<body>
<h1>更新返乡防疫登记</h1>
<form action="update" method="POST">
    <input name="id" type="hidden" value="${returnPerson.id}">
    <p>
        姓名：<input name="personName" type="text" value="${returnPerson.personName}">
    </p>
    <p>
        身份证：<input name="personId" type="text" value="${returnPerson.personId}">
    </p>
    <p>
        电话：<input name="personPhone" type="text" value="${returnPerson.personPhone}">
    </p>
    <p>
        出发城市：<input name="sendCity" type="text" value="${returnPerson.sendCity}">
    </p>
    <p>
        返乡日期：<input name="returnDate" type="text" value="<fmt:formatDate value='${returnPerson.returnDate}' pattern='yyyy-MM-dd'/>">（yyyy-MM-dd）
    </p>
    <p>
        创建日期：<input name="createDate" type="text" value="<fmt:formatDate value='${returnPerson.createDate}' pattern='yyyy-MM-dd'/>">
    </p>
    <p>
        是否访谈：
        <select name="interviewStatus">
            <option value="N">否</option>
            <option value="Y">是</option>
        </select>
    </p>
    <p>
        <input type="submit" value="保存">
        <input type="reset" value="清空">
    </p>
</form>

</body>
<script type="text/javascript" src="${pageContext.request.contextPath}/statics/js/jquery.js"/>
<script>

    $(function(){
        let interviewStatus = ${returnPerson.interviewStatus};
        console.log(interviewStatus)
        if(interviewStatus == 'N'){
            $("input[name='interviewStatus'][value='N']").val("否");
        } else {
            $("input[name='interviewStatus'][value='Y']").val("是");
        }
    })
</script>
</html>
